package com.ct.ioc;

import com.ct.ioc.controller.UserController;
import com.ct.ioc.controller.UserController2;
import com.ct.ioc.controller.UserController3;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

@SpringBootApplication
public class SpringIocDemoApplication {

	public static void main(String[] args) {
		ApplicationContext context = SpringApplication.run(SpringIocDemoApplication.class, args);
//		UserController bean = context.getBean(UserController.class);
//		bean.sayHi();
//		UserController userController = (UserController) context.getBean("userController");
//		userController.sayHi();

//		UserComponent bean = context.getBean(UserComponent.class);
//		bean.doComponent();
//		UserComponent userComponent = (UserComponent) context.getBean("userComponent");
//		userComponent.doComponent();

//		UserInfoConfig bean = context.getBean(UserInfoConfig.class);
//		System.out.println(bean.user1());

//		UserController bean = context.getBean(UserController.class);
//		bean.sayHi();

//		UserController2 bean = context.getBean(UserController2.class);
//		bean.sayHi();

//		UserController3 bean = context.getBean(UserController3.class);
//		bean.sayHi();

//		UserController bean = context.getBean(UserController.class);
//		bean.sayHi();
	}

}
